using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace LMSData
{

    public partial class CourseController
    {

        public CourseCollection GetCoursesByName(string CourseName)
        {
            CourseCollection coll = new CourseCollection();
            Query qry = new Query(Course.Schema);
            qry.AddWhere(Course.Columns.CourseName, SubSonic.Comparison.Like, CourseName + "%");
            qry.AddWhere(Course.Columns.IsDeleted, false);
            coll.LoadAndCloseReader(qry.ExecuteReader());
            return coll;
        }

        public static CourseCollection GetCourses()
        {
            CourseCollection coll = new CourseCollection();
            Query qry = new Query(Course.Schema);
            qry.AddWhere(Course.Columns.IsDeleted, false);
            coll.LoadAndCloseReader(qry.ExecuteReader());
            return coll;
        }
    }
}
